package com.binguo.model.mapper;

import com.binguo.model.core.Mapper;
import com.binguo.model.model.DiscountOrder;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface DiscountOrderMapper extends Mapper<DiscountOrder> {

    @Select("SELECT COUNT(*) FROM discount_order WHERE customerId = #{customerId}  AND shopId = #{shopId} AND created BETWEEN #{startTime}  AND #{endTime} ")
    Integer findDisCountOrderCount(@Param("customerId") Integer customerId, @Param("shopId") Integer shopId, @Param("startTime") String startTime, @Param("endTime") String endTime);

    @Delete("DELETE FROM discount_order")
    void deleteAllDiscountOrder();

}